#include "pch.h"
#include "CppUnitTest.h"

using namespace StyleMVVM;
using namespace Microsoft::VisualStudio::CppUnitTestFramework;

using namespace StyleMVVM_Cpp_UnitTests;

namespace StyleMVVM_Cpp_UnitTests
{
	TEST_CLASS(DependencyInjectionTests)
	{
	public:
		
		TEST_METHOD(SimpleExportTest)
		{
			Bootstrapper^ bootstrapper = ref new Bootstrapper();

			SimpleType::RegisterExport(bootstrapper->Container);
			SimpleExport::RegisterExport(bootstrapper->Container);

			bootstrapper->Start();
			
			SimpleExport^ export = 
				dynamic_cast<SimpleExport^>(bootstrapper->Container->Locate("SimpleExport",nullptr));

			Assert::IsNotNull(export);
			Assert::IsNotNull(export->TestExport);

			bootstrapper->Shutdown();
		}

	};
}